<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>事件简介</title>
    <style>
        section {
            background-color: #ddd;
            padding: 40px;
        }
    </style>
</head>
<body>
    <section>
        <button id="button">点击切换背景颜色</button>
    </section>

    <script>
        var btn = document.getElementById('button');
        var section = document.querySelector('section');
        var flag = false;

        btn.addEventListener('click', function() {
            section.style.backgroundColor = flag ? '#ddd' : '#bbb';
            flag = !flag;
        }, false);
    </script>
</body>
</html>